CacheType
Functions for creating and reading a single-flight cache.
Specification
Kind
Type
Members
8
Examples
0
makeSignature
Cache.make lookup
makeBoundedSignature
Cache.makeBounded capacity lookup
makeBoundedWithExpirySignature
Cache.makeBoundedWithExpiry capacity timeToLive lookup
makeRecSignature
Cache.makeRec lookup
getSignature
Cache.get key cache
Summary
| Name | Signature | Synopsis |
|---|---|---|
| Operations | ||
| make | Cache.make lookup | Creates a cache that computes missing values with lookup. |
| makeBounded | Cache.makeBounded capacity lookup | Creates a cache retaining at most capacity keys, evicting the least recently read key. |
| makeBoundedWithExpiry | Cache.makeBoundedWithExpiry capacity timeToLive lookup | Creates an LRU cache whose successful entries expire after timeToLive of monotonic clock time. |
| makeRec | Cache.makeRec lookup | Creates a cache whose lookup may read other keys through the same cache. |
| get | Cache.get key cache | Returns the cached value for a key, or starts its lookup. |
| invalidate | Cache.invalidate key cache | Forgets a key without interrupting existing waiters. |
| invalidateAll | Cache.invalidateAll cache | Forgets every cached key. |
| count | Cache.count cache | Returns the number of retained keys, including in-flight lookups. |
Operations
kind:member
kind:member
kind:member
Creates an LRU cache whose successful entries expire after
timeToLive of monotonic clock time.Parameters
| Name | Type | Description |
|---|---|---|
| capacity | int | |
| timeToLive | TimeSpan | |
| lookup | 'key -> Flow<'env, 'error, 'value> |
Returns
Flow<'env, 'none, Cache<'key, 'error, 'value>>
kind:member
kind:member
kind:member
kind:member

